//package com.dc.system.service.impl;
//
//import java.text.ParseException;
//import java.util.Date;
//
//import javax.transaction.Transactional;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import com.dc.base.util.DateUtil;
//import com.dc.common.model.BaseModel;
//import com.dc.system.controller.UserController;
//import com.dc.system.mapper.LoginLogMapper;
//import com.dc.system.model.SysLoginLog;
//import com.dc.system.model.SystemLoginLog;
//import com.dc.system.model.SystemUser;
//import com.dc.system.service.SysLoginLogService;
//
//@Service
//@Transactional
//public class SysLoginLogServiceImpl implements SysLoginLogService{
//	
//	private static final Logger logger = LoggerFactory.getLogger(SysLoginLogServiceImpl.class);
//	
//	@Autowired
//	private LoginLogMapper loginLogMapper;
//	
//	@Override
//	public BaseModel insertSysUserLoginLog(SysLoginLog sysLoginLog, BaseModel baseModel, SysUser sysUser) {
//		try {
//			sysLoginLog.setLogin_date(DateUtil.formatDate(new Date()));
//		} catch (ParseException e) {
//			baseModel.setCode(-10004);
//			baseModel.setMessage("时间转换失败，请联系管理员处理");
//			logger.error("时间转换失败", e);
//			return baseModel;
//		}
//		if(baseModel.getCode()==0){
//			systemLoginLog.setUser_id(((SystemUser)baseModel.getData()).getUser_id());
//		}
//		systemLoginLog.setUser_account(systemUser.getUser_account());
//		systemLoginLog.setUser_password(systemUser.getUser_password());
//		try {
//			sysUserLoginLogMapper.insertLoginLog(systemLoginLog);
//			//插入操作会在xml文件配置之后可以直接把插入返回的id值直接映射给实体类
//			//System.out.println("getUserLoginLogId:****" + sysUserLoginLog.getUserLoginLogId());
//		} catch (Exception e) {
//			baseModel.setCode(-10005);
//			baseModel.setMessage("登陆日志插入失败，请联系管理员处理");
//			logger.error("登陆日志插入失败", e);
//			return baseModel;
//		}
//		return baseModel;
//	}
//	
//}
